﻿var bigscreen = false;
if (screen.width >= 1200) {
	bigscreen = true;
	var bodyTag = document.getElementsByTagName("body")[0], bodyClassName = bodyTag.getAttribute("className") || bodyTag.getAttribute("class");
	bodyClassName = bodyClassName ? bodyClassName + " " : "";
	bodyTag.className = bodyClassName + "root1200";
}

$(document).ready(

function() {

	var snActive = window.snActive = document.getElementById("snActive-wrap"), a = snActive.getElementsByTagName("a"), h = 0, w, imgSrc = [];
	if (bigscreen) {
		w = 962;
		imgSrc[0] = "/shopping/images/adver/1390124028186.jpg";// 40
		imgSrc[1] = "/shopping/images/adver/1390124043025.jpg";// 500
	} else {
		w = 990;
		imgSrc[0] = "/shopping/images/adver/1390124028186.jpg";// 40
		imgSrc[1] = "/shopping/images/adver/1390124043025.jpg";// 500
	}
	snActive.style.overflow = 'hidden';
	a[0].style.display = "none";
	a[0].innerHTML += '<img width="' + w + '" height="21" src="' + imgSrc[0] + '" style="display:block" />';
	if (a[1]) {
		a[1].innerHTML += '<img width="' + w + '" height="548" src="' + imgSrc[1] + '" style="display:block" />';
	}

	// 关闭通栏广告
	var snActive = $(snActive), hideImg = snActive.find('a:hidden'), em = snActive.find("em");
	var timeout = !1;
	if (hideImg[0]) {
		timeout = setTimeout(function() {
			snActive.animate({
				height : 21
			}, 600, function() {
				hideImg.siblings('a:visible').hide();
				hideImg.show();
				em.show().live("click", function() {
					snActive.slideUp(300);
				});
			});
		}, 3000);
	}

}

);
